package x10.interfaces;

/* 
 * Java libusb wrapper
 * Copyright (c) 2005-2006 Andreas Schlpfer <spandi at users.sourceforge.net>
 *
 * http://libusbjava.sourceforge.net
 * This library is covered by the LGPL, read LGPL.txt for details.
 */

public abstract class AbstractDeviceInfo {

	private static short idVendor;
	private static short idProduct;
	private String filename = null;
	private String busName = null;
	private static int timeout;
	private static int configuration;
	private static int interface_;
	private static int altinterface;
	private static int outEPBulk = -1;
	private static int inEPBulk = -1;
	private static int outEPInt = -1;
	private static int inEPInt = -1;
	private static int sleepTimeout;
	private static int maxDataSize;
	private static TransferMode mode;
	private boolean compareData = true;
	private String manufacturer = null;
	private String product = null;
	private String serialVersion = null;

	public static enum TransferMode {
		Bulk, Interrupt
	}

	public AbstractDeviceInfo() {
		initValues();
	}

	abstract public void initValues();

	public static int getAltinterface() {
		return altinterface;
	}

	public static int getConfiguration() {
		return configuration;
	}

	public static short getIdProduct() {
		return idProduct;
	}

	public static short getIdVendor() {
		return idVendor;
	}

	public static int getInEPBulk() {
		return inEPBulk;
	}

	public static int getInEPInt() {
		return inEPInt;
	}

	public static int getInterface() {
		return interface_;
	}

	public int getMaxDataSize() {
		return maxDataSize;
	}

	public int getOutEPBulk() {
		return outEPBulk;
	}

	public static int getOutEPInt() {
		return outEPInt;
	}

	public int getSleepTimeout() {
		return sleepTimeout;
	}

	public static int getTimeout() {
		return timeout;
	}

	public static void setAltinterface(int altinterface) {
		AbstractDeviceInfo.altinterface = altinterface;
	}

	public static void setConfiguration(int configuration) {
		AbstractDeviceInfo.configuration = configuration;
	}

	public static void setIdProduct(short idProduct) {
		AbstractDeviceInfo.idProduct = idProduct;
	}

	public static void setIdVendor(short idVendor) {
		AbstractDeviceInfo.idVendor = idVendor;
	}

	public static void setInEPBulk(int in_ep_bulk) {
		AbstractDeviceInfo.inEPBulk = in_ep_bulk;
	}

	public static void setInEPInt(int in_ep_int) {
		AbstractDeviceInfo.inEPInt = in_ep_int;
	}

	public static void setInterface(int interface_) {
		AbstractDeviceInfo.interface_ = interface_;
	}

	public static void setMaxDataSize(int maxDataSize) {
		AbstractDeviceInfo.maxDataSize = maxDataSize;
	}

	public static void setOutEPBulk(int out_ep_bulk) {
		AbstractDeviceInfo.outEPBulk = out_ep_bulk;
	}

	public static void setOutEPInt(int out_ep_int) {
		AbstractDeviceInfo.outEPInt = out_ep_int;
	}

	public static void setSleepTimeout(int sleepTimeout) {
		AbstractDeviceInfo.sleepTimeout = sleepTimeout;
	}

	public static void setTimeout(int timeout) {
		AbstractDeviceInfo.timeout = timeout;
	}

	public TransferMode getMode() {
		return mode;
	}

	public static void setMode(TransferMode mode) {
		AbstractDeviceInfo.mode = mode;
	}

	public boolean doCompareData() {
		return compareData;
	}

	public void setDoCompareData(boolean compareData) {
		this.compareData = compareData;
	}

	public String getManufacturer() {
		return manufacturer;
	}

	public void setManufacturer(String manufacturer) {
		this.manufacturer = manufacturer;
	}

	public String getProduct() {
		return product;
	}

	public void setProduct(String product) {
		this.product = product;
	}

	public String getSerialVersion() {
		return serialVersion;
	}

	public void setSerialVersion(String serialVersion) {
		this.serialVersion = serialVersion;
	}

	public String getFilename() {
		return filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public String getBusName() {
		return busName;
	}

	public void setBusName(String busName) {
		this.busName = busName;
	}
}
